#include "string.h"
namespace mjw
{
	void Teststring1()
	{
		mjw::string s1("hello world");
		cout << s1.c_str() << endl;
		for (int i = 0; i < s1.size(); ++i)
		{
			//s1[i]++;
			cout << s1[i] << " ";
		}
		cout << endl;

		mjw::string::iterator it = s1.begin();
		while (it != s1.end())
		{
			cout << *it << " ";
			++it;
		}
		cout << endl;

		for (auto& e : s1)
		{
			cout << e << " ";
		}
		cout << endl;
		/*string s2;
		cout << s2.c_str() << endl;*/
	}
	void Teststring2()
	{
		string s1("hello world");
		string s2(s1);
		
		/*s2.push_back('a');
		s2.push_back('b');
		s2.push_back('c');
		s2.push_back('d');
		s2.push_back('e');
		s2.push_back('f');
		s2.push_back('g');
		s2.push_back('h');*/
		/*s2 += '1';
		s2 += '1';
		s2 += '1';
		s2 += '1';
		s2 += '1';*/

		//s1.append("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
		/*s1 += "aaaaaaaaaaaaaaaaaaaaaaaaa";*/
		cout << s1.c_str() << endl;
		cout << s2.c_str() << endl;
	}
	void Teststring3()
	{
		string s1("abcdefghi");
		size_t find = s1.find('a');
		s1.erase(find,5);
		cout << s1.c_str() << endl;
	}
}
int main()
{
	//mjw::Teststring1();
	mjw::Teststring2();
	//mjw::Teststring3();

	return 0;
}